#include "loger.hpp"
#include <vector>

void fun(int i)
{
    while (1)
    {
        LOG_INFO("thread[%d] looping...\n", i);
        std::this_thread::sleep_for(std::chrono::milliseconds(10));
    }
}

int main(int argc, char **argv)
{
    lxz::loger *loger = lxz::loger::getInstance();

    loger->init(lxz::LOG_LEVEL_INFO, lxz::LOG_TYPE_CHUNK_FILE, "./test_chunk_file.log");

    std::vector<std::shared_ptr<std::thread>> threads;

    for (int i = 0; i < 8; ++i)
    {
        threads.push_back(std::make_shared<std::thread>(fun, i));
    }

    for (int i = 0; i < 8; ++i)
    {
        threads[i]->join();
    }

    return 0;
}